home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mac Magazin/MacEasy 11
/
Mac Magazin and MacEasy Magazine CD - Issue 11.iso
/
Sharewarebibliothek
/
Entwickler
/
ShowInitIcon
/
Usage & History
< prev
Wrap
Text File
|
1995-05-30
|
2KB
|
34 lines
// ----------------------------------------------------------------------------------------------------------------
Should I use it as a standalone code resource or link it into my INIT?
I recommend linking the code to your INIT resource, because it's easier and cleaner, *provided* that your INIT resource is
written properly, that is, it is destroyed once startup is over. If your INIT installs trap patches, then the code for the trap
patches should be compiled into a separate resource (or code fragment, on the PowerPC) and only the code for the patches
should remain resident. Filling the System heap with old INIT code isn't cool.
If you decide to use this code as a standalone resource, here is a snippet that shows how to load and call it:
Handle theResource;
theResource = Get1Resource('Code', 7000);
if (theResource)
((pascal void (*) (short, Boolean)) *theResource) (myIconFamilyID, true);
Note that I don't call HLock because the resource is marked as Locked, and I don't call ReleaseResource because the
INIT resource file is going to be closed after the INIT executes, unloading all resources.
// ----------------------------------------------------------------------------------------------------------------
History:
1.0 Initial release
1.0.1 Modified to work with MPW C compiler (replaced variables at absolute address with macros)
Removed dependency on precompiled headers
Thanks to Devon Hubbard, Martin Minow, Jason Proctor.
// ----------------------------------------------------------------------------------------------------------------
François Pottier <pottier@dmi.ens.fr>
May 30th, 1995